Skip to content

chore: remove AI code slop across the codebase - #220

Merged
CodeWithMa merged 2 commits into
CodeWithMa:devfrom
CodeWithMaBot:chore/deslop-codebase
Nov 27, 2026
Merged

CodeWithMa merged 2 commits into
CodeWithMa:devfrom
CodeWithMaBot:chore/deslop-codebase

Conversation

@CodeWithMaBot

@CodeWithMaBot CodeWithMaBot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A cleanup pass over the whole codebase that keeps behavior the same: 55 files, +433/−820.

  • Type escapes: non-null ! and needless casts are replaced by narrowing (@if (x; as y), local consts). Return types and generics that inference already covers are dropped.
  • Duplication collapsed:
    • provider settings defaults (built 3×)
    • round-robin comparator
    • stats status counts
    • home backlog/paused filters
    • season-editor patch blocks
    • AniList search query
    • storage migration item loops
  • Flatter code: early returns and small helpers replace deep nesting. importData drops its large try/catch in favor of a parseJson helper.
  • Unreachable guards removed: each one checked something that callers or the zod schema already guarantee, e.g. ?? {} on schema-required records, private persistentStorage re-checks, and an unreachable round-robin branch.
  • Specs:
    • A typed file-selection helper in the settings spec replaces about 15 as unknown as casts.
    • A 12-line FileReader double replaces a 90-line mock.
    • Real Files replace stubbed text() in some specs; a few settings fixtures still stub it.
    • Two comments that were factually wrong are fixed or removed.

Known gap (pre-existing, not addressed)

fake-indexeddb turns stored jsdom Blobs into empty objects, so the poster export specs never check real base64 image content.

Test plan

  • bun run lint
  • bun run test --no-watch — 58 files, 1062 tests pass
  • bun run build (the initial bundle budget warning was already there before this change)
  • bun run e2e with nix-shell Chromium — journey passes

🤖 Generated with Claude Code

- Narrow instead of non-null assertions and casts; drop annotations and
  generics that inference covers.
- Collapse duplicated blocks (provider settings defaults, round-robin
  comparator, stats counts, home filters, season-editor patches, AniList
  search query, storage migration loops).
- Flatten nesting with early returns and small helpers.
- Remove unreachable guards whose callers or schemas already guarantee
  the condition.
- Simplify specs: typed file-selection helper in settings spec, a
  minimal FileReader double, real Files instead of stubbed text().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@CodeWithMaBot is attempting to deploy a commit to the Ma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 29a35696-63eb-43b9-b474-2f45720c6dd4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Codecov's patch check failed at 84.83% against a 90.16% target. Most of
the misses were in stats and theme code the cleanup rewrote, which had
no specs.

- Stats spec: series and movie status counts, current streak (today,
  yesterday, broken), and time-of-day buckets.
- Theme switcher spec: the system → light → dark → system cycle with
  saved choices, OS changes in system mode, explicit choices ignoring
  the OS, and an unknown stored value.
- ITEM_STATUSES is now a readonly tuple. Dropping the field annotation
  in item-form had made its inferred type mutable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
watch-list Ready Ready Preview Nov 27, 2026 12:31pm UTC

@CodeWithMa
CodeWithMa merged commit 2d54bdc into CodeWithMa:dev Nov 27, 2026
10 checks passed
CodeWithMa pushed a commit that referenced this pull request Nov 27, 2026
Without a codecov.yml, the patch target was dev's current coverage. It
rose with every well-tested merge and failed refactors that touched
untested code (PR #220 hit an unchosen 90.16% bar).

The patch check now has a fixed 85% target. The project check keeps
its auto target with 0.5% slack, so small drops after deleting code
do not fail a PR.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@CodeWithMaBot
CodeWithMaBot deleted the chore/deslop-codebase branch November 27, 2026 13:17

This branch was successfully deployed

1 active deployment
Preview — 177ae6fa Deployed Nov 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants